﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Workflow.Domain.Model;
using WorkflowCore.Persistence.EntityFramework.Models;
using WorkflowCore.Persistence.EntityFramework.Services;

namespace Workflow.Domain
{
    public class WorkflowContext : WorkflowDbContext
    {
        public DbSet<DefinitionModel> definition { get; set; }
        public DbSet<InstanceModel> instance { get; set; }
        public DbSet<AuditModel> audit { get; set; }
        public DbSet<PersistedEvent> Event {  get; set; }
        public DbSet<PersistedExecutionError> ExecutionError {  get; set; }
        public DbSet<PersistedExecutionPointer> ExecutionPointer {  get; set; }
        public DbSet<PersistedExtensionAttribute> ExtensionAttribute {  get; set; }
        public DbSet<PersistedScheduledCommand> ScheduledCommand {  get; set; }
        public DbSet<PersistedSubscription> Subscription {  get; set; }
        public DbSet<PersistedWorkflow> Workflow {  get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            optionsBuilder.UseMySql("Server=39.103.49.30;uid=root;pwd=FLHsly221101@forever;database=Workflow;", new MySqlServerVersion("5.7"));
        }
        protected override void ConfigureEventStorage(EntityTypeBuilder<PersistedEvent> builder)
        {
            
        }

        protected override void ConfigureExecutionErrorStorage(EntityTypeBuilder<PersistedExecutionError> builder)
        {
            
        }

        protected override void ConfigureExecutionPointerStorage(EntityTypeBuilder<PersistedExecutionPointer> builder)
        {
            
        }

        protected override void ConfigureExetensionAttributeStorage(EntityTypeBuilder<PersistedExtensionAttribute> builder)
        {
            
        }

        protected override void ConfigureScheduledCommandStorage(EntityTypeBuilder<PersistedScheduledCommand> builder)
        {
            
        }

        protected override void ConfigureSubscriptionStorage(EntityTypeBuilder<PersistedSubscription> builder)
        {
            
        }

        protected override void ConfigureWorkflowStorage(EntityTypeBuilder<PersistedWorkflow> builder)
        {
            
        }
    }
}
